package org.yellow.backend.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yellow.backend.pojo.medicinedispence;
import org.yellow.backend.service.medicinedispenceService;

/**
 * @author: hy
 * @create: 2024-01-01
 */
@RestController
@SuppressWarnings({"all"})
@RequestMapping("/medicinedis")
public class medicinedispenceController {
    @Autowired
    private medicinedispenceService service;
    @GetMapping("/{id}")
    public medicinedispence getMedicineDis(@PathVariable("id") int id){
        return service.selectMedicinedispenceById(id);
    }

    @PostMapping("/insert")
    public boolean insertNew(@RequestBody medicinedispence md){
        return service.insertNew(md);
    }


    @DeleteMapping("/delete/{id}")
    public boolean deleteOld(@PathVariable("id") int id){
        return service.deleteOld(id);
    }
}
